<template>
  <div>
    <h1>msg nuxt</h1>
    <hr>
    <h3>disabled ssr</h3>
    <no-ssr placeholder="Loading...">
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="Type" label="类型"></el-table-column>
        <el-table-column prop="Content" label="内容"></el-table-column>
        <el-table-column prop="PublishTime" label="时间"></el-table-column>
      </el-table>
    </no-ssr>
  </div>
</template>

<script>
import axios from "axios";
 import NoSSR from 'vue-no-ssr';

export default {
  head() {
    return {
      title: "msg",
      meta: [
        { hid: "description", name: "msg name", content: "My msg description" }
      ]
    };
  },
  components: {
      'no-ssr': NoSSR
  },
  asyncData({ params }) {
    // axios.defaults.baseURL = "https://mock.yjyz.com/mock";
    // axios.defaults.headers["Authorization"] ="";

    // return axios
    //   .get("/5c9209b7ca98815ddec93266/api_copy/getHouseList", {})
    //   .then(response => {
    //     return { tableData: response.data["data"]["list"] };
    //   })
    //   .catch(function(error) {
    //     console.log(error);
    //   });

    //     axios.defaults.headers.common['Authorization'] = "Basic dWp1ejpmb2xsb3d1cA=="; 
    // axios.defaults.baseURL = "https://api-beta.yjyz.com/erp.followup.srv/api/v1/followup";
    // return axios.get("/search",{params:{
    //   Type:"二手房",Index:1,Limit:50,OrderBy:0,Content:"",CityCode:450124
    // },  headers: { "Access-Control-Allow-Origin": "*" }})
    //   .then(response => {
    //     console.log('获取http2',response.data["data"]["list"]);
    //     return { tableData: response.data["data"]["list"] };
    //   })
    //   .catch(function(error) {
    //     console.log(error);
    //   });
  },
  data() {
    return {
      tableData: []
    };
  }
};
</script>

<style scoped>
</style>